home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / smtpse_1 / mainform.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-05-27  |  6.9 KB  |  231 lines

  1. VERSION 5.00
  2. Object = "{E5DC7841-F5DC-11D1-8BC8-008048FD3EC9}#1.0#0"; "KSMTPSrv.ocx"
  3. Begin VB.Form MainForm 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "SMTP Server Demo"
  6.    ClientHeight    =   2445
  7.    ClientLeft      =   2145
  8.    ClientTop       =   2505
  9.    ClientWidth     =   5580
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   2445
  14.    ScaleWidth      =   5580
  15.    Begin KSMTPSRV.SMTPServer SMTPServer1 
  16.       Left            =   60
  17.       Top             =   240
  18.       _ExtentX        =   714
  19.       _ExtentY        =   714
  20.    End
  21.    Begin VB.CheckBox chkSaveMail 
  22.       Alignment       =   1  'Right Justify
  23.       Caption         =   "Save E-Mail as File:"
  24.       Height          =   195
  25.       Left            =   240
  26.       TabIndex        =   18
  27.       Top             =   1680
  28.       Value           =   1  'Checked
  29.       Width           =   1695
  30.    End
  31.    Begin VB.TextBox txtTimeout 
  32.       Height          =   285
  33.       Left            =   1740
  34.       TabIndex        =   17
  35.       Text            =   "20"
  36.       Top             =   1320
  37.       Width           =   315
  38.    End
  39.    Begin VB.TextBox txtIPAdress 
  40.       Height          =   285
  41.       Left            =   1740
  42.       TabIndex        =   15
  43.       Top             =   1020
  44.       Width           =   1755
  45.    End
  46.    Begin VB.CommandButton Command3 
  47.       Caption         =   "About"
  48.       Height          =   255
  49.       Left            =   4560
  50.       TabIndex        =   13
  51.       Top             =   1740
  52.       Width           =   735
  53.    End
  54.    Begin VB.TextBox txtMaxConnect 
  55.       Height          =   285
  56.       Left            =   1740
  57.       TabIndex        =   12
  58.       Text            =   "10"
  59.       Top             =   720
  60.       Width           =   1755
  61.    End
  62.    Begin VB.CommandButton Command2 
  63.       Caption         =   "Stop"
  64.       Height          =   255
  65.       Left            =   4560
  66.       TabIndex        =   10
  67.       Top             =   1320
  68.       Width           =   735
  69.    End
  70.    Begin VB.CommandButton Command1 
  71.       Caption         =   "Start"
  72.       Height          =   255
  73.       Left            =   4560
  74.       TabIndex        =   9
  75.       Top             =   1020
  76.       Width           =   735
  77.    End
  78.    Begin VB.Frame Frame1 
  79.       Caption         =   "Status:"
  80.       Height          =   795
  81.       Left            =   4320
  82.       TabIndex        =   4
  83.       Top             =   60
  84.       Width           =   1215
  85.       Begin VB.Label txtServer 
  86.          Caption         =   "Down"
  87.          Height          =   255
  88.          Left            =   660
  89.          TabIndex        =   8
  90.          Top             =   480
  91.          Width           =   435
  92.       End
  93.       Begin VB.Label txtOnline 
  94.          Caption         =   "0"
  95.          Height          =   195
  96.          Left            =   660
  97.          TabIndex        =   7
  98.          Top             =   240
  99.          Width           =   255
  100.       End
  101.       Begin VB.Label Label4 
  102.          AutoSize        =   -1  'True
  103.          Caption         =   "Server:"
  104.          Height          =   195
  105.          Left            =   120
  106.          TabIndex        =   6
  107.          Top             =   480
  108.          Width           =   510
  109.       End
  110.       Begin VB.Label Label3 
  111.          AutoSize        =   -1  'True
  112.          Caption         =   "Online:"
  113.          Height          =   195
  114.          Left            =   120
  115.          TabIndex        =   5
  116.          Top             =   240
  117.          Width           =   495
  118.       End
  119.    End
  120.    Begin VB.TextBox txtPort 
  121.       Height          =   285
  122.       Left            =   1740
  123.       TabIndex        =   3
  124.       Text            =   "25"
  125.       Top             =   420
  126.       Width           =   315
  127.    End
  128.    Begin VB.TextBox txtSaveMailPath 
  129.       Height          =   285
  130.       Left            =   1740
  131.       TabIndex        =   1
  132.       Text            =   "C:\"
  133.       Top             =   120
  134.       Width           =   1755
  135.    End
  136.    Begin VB.Label statuslabel 
  137.       Height          =   195
  138.       Left            =   360
  139.       TabIndex        =   19
  140.       Top             =   2220
  141.       Width           =   4875
  142.    End
  143.    Begin VB.Label Label7 
  144.       AutoSize        =   -1  'True
  145.       Caption         =   "Timeout:"
  146.       Height          =   195
  147.       Left            =   1080
  148.       TabIndex        =   16
  149.       Top             =   1380
  150.       Width           =   615
  151.    End
  152.    Begin VB.Label Label6 
  153.       Caption         =   "IP Adress:"
  154.       Height          =   195
  155.       Left            =   960
  156.       TabIndex        =   14
  157.       Top             =   1080
  158.       Width           =   735
  159.    End
  160.    Begin VB.Label Label5 
  161.       Caption         =   "Max. Connections:"
  162.       Height          =   195
  163.       Left            =   360
  164.       TabIndex        =   11
  165.       Top             =   780
  166.       Width           =   1335
  167.    End
  168.    Begin VB.Label Label2 
  169.       Caption         =   "Port:"
  170.       Height          =   195
  171.       Left            =   1320
  172.       TabIndex        =   2
  173.       Top             =   480
  174.       Width           =   375
  175.    End
  176.    Begin VB.Label Label1 
  177.       Caption         =   "Save Mail in:"
  178.       Height          =   195
  179.       Left            =   780
  180.       TabIndex        =   0
  181.       Top             =   180
  182.       Width           =   915
  183.    End
  184. Attribute VB_Name = "MainForm"
  185. Attribute VB_GlobalNameSpace = False
  186. Attribute VB_Creatable = False
  187. Attribute VB_PredeclaredId = True
  188. Attribute VB_Exposed = False
  189. Private Sub Command1_Click()
  190.   SMTPServer1.MaxConnection = Val(txtMaxConnect)
  191.   SMTPServer1.ServerPort = Val(txtPort)
  192.   SMTPServer1.IncommingPath = txtSaveMailPath
  193.   SMTPServer1.Timeout = Val(txtTimeout)
  194.   SMTPServer1.LocalIP = txtIPAdress
  195.   SMTPServer1.SaveMessage = chkSaveMail.Value
  196.     txtSaveMailPath.Enabled = False
  197.     txtPort.Enabled = False
  198.     txtMaxConnect.Enabled = False
  199.     txtIPAdress.Enabled = False
  200.     txtTimeout.Enabled = False
  201.     chkSaveMail.Enabled = False
  202.       SMTPServer1.ServerListen
  203. End Sub
  204. Private Sub Command2_Click()
  205.   SMTPServer1.ServerClose
  206.     txtSaveMailPath.Enabled = True
  207.     txtPort.Enabled = True
  208.     txtMaxConnect.Enabled = True
  209.     txtIPAdress.Enabled = True
  210.     txtTimeout.Enabled = True
  211.     chkSaveMail.Enabled = True
  212. End Sub
  213. Private Sub Command3_Click()
  214.   SMTPServer1.ShowAbout
  215. End Sub
  216. Private Sub SMTPServer1_Connections(Sessions As Integer)
  217.   txtOnline = Str(Sessions)
  218. End Sub
  219. Private Sub SMTPServer1_NewMailData(MsgFrom As Variant, MsgTo As Variant, MsgBody As String)
  220.   MsgBox "Event NewMailData"
  221. End Sub
  222. Private Sub SMTPServer1_NewMailFile(FileName As String)
  223.   statuslabel.Caption = "New Mail saved as: " + FileName
  224. End Sub
  225. Private Sub SMTPServer1_Shutdown()
  226.   txtServer.Caption = "Down"
  227. End Sub
  228. Private Sub SMTPServer1_Startup()
  229.   txtServer.Caption = "Up"
  230. End Sub
  231.